/**
 * time: 2025-09-16
 * author: XJ
 * description: 资金拨付
 */

import { PageContainer } from '@ant-design/pro-components';
import { Button, DatePicker, Form, Input, InputNumber, Radio, Row, Select, Steps, TreeSelect } from 'antd';
import { Col } from 'antd/lib';
import dayjs from 'dayjs';
import area from '@/components/staticFile/region_options.json';
import product from '@/components/staticFile/product_options.json';
import TextArea from 'antd/es/input/TextArea';
import chinaEconomy from '@/components/staticFile/industry_classification_options.json';
import { useModel } from '@umijs/max';

// 统一样式常量，与前序页面保持一致
const COMMON_FIELD_STYLE = { width: '100%', height: 40, borderRadius: 4 };
const FORM_LAYOUT = {
  labelCol: { span: 5 },
  wrapperCol: { span: 19 },
  layout: 'horizontal' as const,
  
  size: 'middle' as const,
};

const StepFivePage: React.FC = (props) => {
  const onFinish = (values: any) => {};
  const onFinishFailed = (values: any) => {};
  const { initialState, setInitialState } = useModel('@@initialState');

  return (
    <div
      style={{
        padding: '20px',
        boxSizing: 'border-box',
        backgroundColor: '#f8f9fa',
        height: '100%',
        overflow: 'hidden',
      }}
    >
      <div
        style={{
          backgroundColor: '#fff',
          padding: '20px',
          borderRadius: 8,
          boxShadow: '0 1px 3px rgba(0,0,0,0.05)',
          height: '100%',
          overflowY: 'auto',
        }}
      >
        <Form {...FORM_LAYOUT} onFinish={onFinish} onFinishFailed={onFinishFailed}>
          {/* 基础信息组 */}
          {/* <div style={{ marginBottom: 24 }}>
            <div
              style={{
                fontSize: 16,
                fontWeight: 500,
                color: '#1f2937',
                marginBottom: 12,
              }}
            >
              基础信息
            </div>

            <Form.Item
              name="serialNumber"
              label="序号"
              rules={[{ required: true, message: '请输入序号' }]}
              style={{ marginBottom: 20 }}
            >
              <Input style={COMMON_FIELD_STYLE} />
            </Form.Item>
          </div> */}

          {/* 绩效评价信息组 */}
          <div style={{ marginBottom: 24 }}>
            {/* <div style={{ borderBottom: '1px solid #e8e8e8', marginBottom: 20 }}></div> */}

            <div
              style={{
                fontSize: 16,
                fontWeight: 500,
                color: '#1f2937',
                marginBottom: 12,
              }}
            >
              绩效评价情况
            </div>

            <Form.Item
              name="isPerformanceEvaluated"
              label="是否已开展绩效评价"
              rules={[{ required: true, message: '请选择是否已开展绩效评价' }]}
              style={{ marginBottom: 20 }}
            >
              <Radio.Group
                disabled={initialState?.currentUser?.access == "enterprise"}
                style={{
                  display: 'flex',
                  gap: 24,
                  alignItems: 'center',
                  ...COMMON_FIELD_STYLE,
                }}
              >
                <Radio value="yes">是</Radio>
                <Radio value="no">否</Radio>
              </Radio.Group>
            </Form.Item>
                <Form.Item
              name="isThrough"
              label="绩效评价是否通过"
              rules={[{ required: true, message: '请选择绩效评价是否通过' }]}
              style={{ marginBottom: 20 }}
            >
              <Radio.Group
                disabled={initialState?.currentUser?.access == "enterprise"}
                style={{
                  display: 'flex',
                  gap: 24,
                  alignItems: 'center',
                  ...COMMON_FIELD_STYLE,
                }}
              >
                <Radio value="yes">是</Radio>
                <Radio value="no">否</Radio>
              </Radio.Group>
            </Form.Item>
            {/* <Form.Item
              name="performanceEvaluationResult"
              label="绩效评价"
              rules={[{ required: true, message: '请选择绩效评价结果' }]}
              style={{ marginBottom: 20 }}
            >
              <Select style={COMMON_FIELD_STYLE}>
                <Select.Option value="passed">通过</Select.Option>
                <Select.Option value="notPassed">未通过</Select.Option>
              </Select>
            </Form.Item>

            <Form.Item
              name="performanceEvaluationScore"
              label="绩效评价得分"
              rules={[{ required: true, message: '请输入绩效评价得分或情况说明' }]}
              style={{ marginBottom: 20 }}
            >
              <TextArea
                maxLength={500}
                showCount
                style={{
                  minHeight: 120,
                  resize: 'vertical',
                  ...COMMON_FIELD_STYLE,
                }}
              />
            </Form.Item> */}
          </div>

          {/* 资金拨付信息组 */}
          <div style={{ marginBottom: 24 }}>
            <div style={{ borderBottom: '1px solid #e8e8e8', marginBottom: 20 }}></div>

            <div
              style={{
                fontSize: 16,
                fontWeight: 500,
                color: '#1f2937',
                marginBottom: 12,
              }}
            >
              资金拨付情况
            </div>

            <Form.Item
              name="proposedSubsidyFund"
              label={<>拟对该企业<br/>奖补资金(万元)</>}
              rules={[{ required: true, message: '请输入拟奖补资金', pattern: /^\d+(\.\d+)?$/ }]}
              style={{ marginBottom: 20 }}
            >
              <Input disabled={initialState?.currentUser?.access == "enterprise"} style={COMMON_FIELD_STYLE} />
            </Form.Item>

            <Form.Item
              name="disbursedSubsidyFund"
              label="已拨付奖补资金(万元)"
              rules={[{ required: true, message: '请输入已拨付资金', pattern: /^\d+(\.\d+)?$/ }]}
              style={{ marginBottom: 20 }}
            >
              <Input disabled={initialState?.currentUser?.access == "enterprise"} style={COMMON_FIELD_STYLE} />
            </Form.Item>
          </div>

          {/* 样板企业信息组 */}
          <div style={{ marginBottom: 24 }}>
            <div style={{ borderBottom: '1px solid #e8e8e8', marginBottom: 20 }}></div>

            <div
              style={{
                fontSize: 16,
                fontWeight: 500,
                color: '#1f2937',
                marginBottom: 12,
              }}
            >
              样本培育企业情况
            </div>

            {/* <Form.Item
              name="isModelEnterprise"
              label="是否推荐该企业为样本培育企业"
              rules={[{ required: true, message: '请选择是否推荐该企业为样本培育企业' }]}
              style={{ marginBottom: 20 }}
            >
              <Select style={COMMON_FIELD_STYLE}>
                <Select.Option value="yes">是</Select.Option>
                <Select.Option value="no">否</Select.Option>
              </Select>
            </Form.Item> */}
              <Form.Item
              name="isYb"
              label={<>是否推荐该企业为<br />样本培育企业</>}
              rules={[{ required: true, message: '请选择是否推荐该企业为样本培育企业' }]}
              style={{ marginBottom: 20 }}
            >
              <Radio.Group
                disabled={initialState?.currentUser?.access == "enterprise"}
                style={{
                  display: 'flex',
                  gap: 24,
                  alignItems: 'center',
                  ...COMMON_FIELD_STYLE,
                }}
              >
                <Radio value="yes">是</Radio>
                <Radio value="no">否</Radio>
              </Radio.Group>
            </Form.Item>
            {/* <Form.Item
              name="enterpriseSelectionReason"
              label="选择该企业理由"
              rules={[{ required: true, message: '请输入选择理由或情况说明' }]}
              style={{ marginBottom: 20 }}
            >
              <TextArea
                maxLength={500}
                showCount
                style={{
                  minHeight: 120,
                  resize: 'vertical',
                  ...COMMON_FIELD_STYLE,
                }}
              />
            </Form.Item> */}
          </div>

          {/* 提交按钮 */}
          {/* <Form.Item label={null} style={{ marginTop: 40, textAlign: 'center' }}>
            <Button type="primary" htmlType="submit">
              提交资金拨付信息
            </Button>
          </Form.Item> */}
        </Form>
      </div>
    </div>
  );
};

export default StepFivePage;
